class SPConstraint:
    """
    Each SP_Constraint object is associated with
    a single node object.

    The SPConstraint class only
    allows time-invariant contraints.  Any constraint
    that varies with time must be implemented in subclasses
    of SPConstraint.
    """

    def __init__(self, constraint_id, node_id, \
                 global_degree_of_freedom, value=0.0, \
                 is_homogeneous=False):

        self.constraint_id = constraint_id
        self.node_id = node_id
        self.global_degree_of_freedom = global_degree_of_freedom
        self.value = value
        self.is_homogeneous = is_homogeneous

    def print_debug_info(self):
        print "node id: " + str(self.node_id)
        print "global dof: " + str(self.global_degree_of_freedom)
        print "value: " + str(self.value)
        print ""


class MPConstraint:

    def __init__(self, retained_node_id, constrained_node_id, \
                 constraint_matrix, constrained_dof):
        self.retained_node_id = retained_node_id
        self.constrained_node_id = constrained_node_id
        self.constraint_matrix = constraint_matrix
        self.constrained_dof = constrained_dof
